package com.example.cms.service.Impl;

import com.example.cms.dao.CategoriesDao;
import com.example.cms.entity.Categories;
import com.example.cms.service.CategoriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("CategoriesService")
@Transactional
public class CategoriesServiceImpl implements CategoriesService {

    @Autowired
    private CategoriesDao categoriesDao;

    @Override
    public List<Categories> selectCate() {
        return categoriesDao.selectCate();
    }

    @Override
    public Integer removeCate(Integer categoriesId) {
        return categoriesDao.deleteCate(categoriesId);
    }

    @Override
    public Integer addCate(Categories categories) {
        return categoriesDao.insertCate(categories);
    }

    @Override
    public Integer editCate(Categories categories) {
        return categoriesDao.updateCate(categories);
    }
}
